<HTML>
<BODY>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->

<B><A HREF="STRCMP.html">STRCMP(3)</A></B>	       FreeBSD Library Functions Manual 	     <B><A HREF="STRCMP.html">STRCMP(3)</A></B>


</PRE>
<H2>NAME</H2><PRE>
     <B>strcmp</B>, <B>strncmp</B>, - compare strings


</PRE>
<H2>SYNOPSIS</H2><PRE>
     <B>#include</B> <B>&lt;string.h&gt;</B>

     <I>int</I>
     <B>strcmp</B>(<I>const</I> <I>char</I> <I>*s1</I>, <I>const</I> <I>char</I> <I>*s2</I>)

     <I>int</I>
     <B>strncmp</B>(<I>const</I> <I>char</I> <I>*s1</I>, <I>const</I> <I>char</I> <I>*s2</I>, <I>size</I><B>_</B><I>t</I> <I>len</I>)


</PRE>
<H2>DESCRIPTION</H2><PRE>
     The <B>strcmp</B>() and <B>strncmp</B>() functions lexicographically compare the null-
     terminated strings <I>s1</I> and <I>s2</I>.


</PRE>
<H2>RETURN VALUES</H2><PRE>
     The <B>strcmp</B>() and <B>strncmp</B>() return an integer greater than, equal to, or
     less than 0, according as the string <I>s1</I> is greater than, equal to, or
     less than the string <I>s2</I>. The comparison is done using unsigned charac-
     ters, so that `\200' is greater than `\0'.

     The <B>strncmp</B>() compares not more than <I>len</I> characters.


</PRE>
<H2>SEE ALSO</H2><PRE>
     <B><A HREF="bcmp.html">bcmp(3)</A></B>,  <B><A HREF="memcmp.html">memcmp(3)</A></B>,  <B><A HREF="strcasecmp.html">strcasecmp(3)</A></B>,  <B><A HREF="strcoll.html">strcoll(3)</A></B>,	<B><A HREF="strxfrm.html">strxfrm(3)</A></B>


</PRE>
<H2>STANDARDS</H2><PRE>
     The <B>strcmp</B>() and <B>strncmp</B>() functions conform to ISO 9899: 1990 (``ISO
     C'').

BSD				 June 4, 1993				     1
</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>
